home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 41.zip / BS1 part 41 / Abacus diskdrives IO.adf / CH8 / write-prot.c < prev    next >
C/C++ Source or Header  |  1978-06-28  |  1KB  |  32 lines

  1. /*-----------------------------------------------------*/
  2. /*       Test Write Protect of the Diskette in DF0:    */
  3. /*       use +L to Compile, -lm -lc to link            */
  4. /*                   JEA, 11-07-87                     */
  5. /*-----------------------------------------------------*/
  6. #include <exec/types.h>
  7. #include <devices/trackdisk.h>
  8.  
  9. /*-----------------------------------------------------*/
  10. /*                  Main Program                       */
  11. /*                                                     */
  12. /*                                                     */
  13. /*-----------------------------------------------------*/
  14. main()
  15. {
  16.  
  17. struct MsgPort *diskport;
  18. struct IOStdReq *diskreq;
  19.  
  20.   diskport = CreatePort( 0L, 0L );
  21.   diskreq = CreateStdIO( diskport );
  22.   OpenDevice( TD_NAME, 0L, diskreq, 0L );
  23.  
  24.   diskreq->io_Command = TD_PROTSTATUS;
  25.   DoIO( diskreq );
  26.   printf( "Write Protect: %ld\n", diskreq->io_Actual );
  27.  
  28.   CloseDevice( diskreq );
  29.   DeleteStdIO( diskreq );
  30.   DeletePort( diskport );
  31. }
  32.